# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-frida
_pkgname=frida
pkgver=15.2.2
pkgrel=4
pkgdesc='Dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers.'
groups=('blackarch' 'blackarch-reversing' 'blackarch-binary')
arch=('x86_64' 'aarch64')
url='https://pypi.org/project/frida/#files'
depends=('python2' 'python2-colorama' 'python2-pygments'
         'python2-prompt_toolkit')
makedepends=('python2-setuptools')
license=('custom:unknown')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
        'https://raw.githubusercontent.com/frida/frida/master/COPYING')
sha512sums=('9abf88124e75d184be30be0647ea1b500b2fede01cc54cd6a64d4fb6eab44a5ede2d8cb0fc6de91a1c5d3f31316a38a9e9a89bfe8472937bf85f24801f805cde'
            'e36c8d5a0538fa4bb3575a60322057f7a687aab04c13deed25399462ba0be74ce6071cc41d967e23b9a96e552462d210280427a945c6cc956919b062878efc9a')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 "$srcdir/COPYING" \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

